package com.example.mac.yuejian14;

import android.content.Context;
import android.content.SharedPreferences;

/**
 * Created by Administrator on 2017/11/14.
 */

public class CacheInfo {
    private SharedPreferences sharedPreferences;

    public CacheInfo(Context context){
        sharedPreferences = context.getSharedPreferences("CacheInfo", Context.MODE_PRIVATE);
    }
    public void setUserIdCache(int userId){
        SharedPreferences.Editor editor = sharedPreferences.edit();
        editor.putString("Cache_UserId", String.valueOf(userId));
        editor.commit();
    }
    public int getUserIdCache(){
        return sharedPreferences.getInt("Cache_UserId", Integer.parseInt(null));
    }

}
